package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AppPushMapper;
import com.ruoyi.system.domain.AppPush;
import com.ruoyi.system.service.IAppPushService;
import com.ruoyi.common.core.text.Convert;

/**
 * 推送Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-07-30
 */
@Service
public class AppPushServiceImpl implements IAppPushService 
{
    @Autowired
    private AppPushMapper appPushMapper;

    /**
     * 查询推送
     * 
     * @param id 推送ID
     * @return 推送
     */
    @Override
    public AppPush selectAppPushById(Long id)
    {
        return appPushMapper.selectAppPushById(id);
    }

    /**
     * 查询推送列表
     * 
     * @param appPush 推送
     * @return 推送
     */
    @Override
    public List<AppPush> selectAppPushList(AppPush appPush)
    {
        return appPushMapper.selectAppPushList(appPush);
    }

    /**
     * 新增推送
     * 
     * @param appPush 推送
     * @return 结果
     */
    @Override
    public int insertAppPush(AppPush appPush)
    {
        appPush.setCreateTime(DateUtils.getNowDate());
        return appPushMapper.insertAppPush(appPush);
    }

    /**
     * 修改推送
     * 
     * @param appPush 推送
     * @return 结果
     */
    @Override
    public int updateAppPush(AppPush appPush)
    {
        appPush.setUpdateTime(DateUtils.getNowDate());
        return appPushMapper.updateAppPush(appPush);
    }

    /**
     * 删除推送对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAppPushByIds(String ids)
    {
        return appPushMapper.deleteAppPushByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除推送信息
     * 
     * @param id 推送ID
     * @return 结果
     */
    @Override
    public int deleteAppPushById(Long id)
    {
        return appPushMapper.deleteAppPushById(id);
    }
}
